# -- coding: utf-8 --
import time
import threading


def song():
    for i in range(5):
        print('[+]songing')
        time.sleep(1)


def dance():
    for i in range(5):
        print('[+]danceing')
        time.sleep(1)


def main():
    print('start---' + time.ctime())
    t1 = threading.Thread(target=song)
    t2 = threading.Thread(target=dance)
    t1.start()
    t2.start()

    while True:
        # 查看数量
        length = len(threading.enumerate())
        print('[+]当前线程数量为:%d'%length)
        if length<= 1:
            break
        time.sleep(1)

if __name__ == '__main__':
    main()
